package com.ruoyi.back.domain;

import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName Chunk
 * @Description TODO 分片
 * @Author luguanqing
 * @Date 2021/4/9 15:54
 * @Version 1.0
 */
@ApiModel("分片实体")
public class Chunk  extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 主键id */
    @ApiModelProperty(value = "主键id")
    private String id;

    /** 当前文件块 */
    @ApiModelProperty(value = "当前文件块")
    private Integer chunkNumber;

    /** 分块大小*/
    @ApiModelProperty(value = "分块大小")
    private Long chunkSize;

    /** 当前分块大小*/
    @ApiModelProperty(value = "当前分块大小")
    private Long currentChunkSize;

    /** 总大小 */
    @ApiModelProperty(value = "总大小")
    private Long totalSize;

    /** 文件标识 */
    @ApiModelProperty(value = "文件标识")
    private String identifier;

    /** 文件名 */
    @ApiModelProperty(value = "文件名")
    private String fileName;

    /** 相对路径 */
    @ApiModelProperty(value = "相对路径")
    private String relativePath;

    /** 总块数 */
    @ApiModelProperty(value = "总块数")
    private Integer totalChunks;

    /** 文件类型 */
    @ApiModelProperty(value = "文件类型")
    private String type;

    /** file */
    @ApiModelProperty(value = "file")
    private MultipartFile file;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getChunkNumber() {
        return chunkNumber;
    }

    public void setChunkNumber(Integer chunkNumber) {
        this.chunkNumber = chunkNumber;
    }

    public Long getChunkSize() {
        return chunkSize;
    }

    public void setChunkSize(Long chunkSize) {
        this.chunkSize = chunkSize;
    }

    public Long getCurrentChunkSize() {
        return currentChunkSize;
    }

    public void setCurrentChunkSize(Long currentChunkSize) {
        this.currentChunkSize = currentChunkSize;
    }

    public Long getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(Long totalSize) {
        this.totalSize = totalSize;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getRelativePath() {
        return relativePath;
    }

    public void setRelativePath(String relativePath) {
        this.relativePath = relativePath;
    }

    public Integer getTotalChunks() {
        return totalChunks;
    }

    public void setTotalChunks(Integer totalChunks) {
        this.totalChunks = totalChunks;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public MultipartFile getFile() {
        return file;
    }

    public void setFile(MultipartFile file) {
        this.file = file;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("chunkNumber", getChunkNumber())
                .append("chunkSize", getChunkSize())
                .append("currentChunkSize", getCurrentChunkSize())
                .append("totalSize", getTotalSize())
                .append("identifier", getIdentifier())
                .append("fileName", getFileName())
                .append("relativePath", getRelativePath())
                .append("totalChunks", getTotalChunks())
                .append("type", getType())
                .append("file", getFile())
                .toString();
    }
}
